from fastapi import APIRouter, Depends
from app.schemas.access_log import AccessLogQueryParams, AccessLogItem
from app.schemas.response import Response
from app.schemas.common import PaginationParams, PaginationResult
from app.services.admin.admin_sys_access_log_service import AdminAccessLogService
from app.core.deps import get_current_user

router = APIRouter(tags=["访问日志"])


@router.get("/list", response_model=Response[PaginationResult[AccessLogItem]])
async def list_access_logs(
    query: AccessLogQueryParams = Depends(), pagination: PaginationParams = Depends(), _=Depends(get_current_user)
):
    result = await AdminAccessLogService.get_access_logs(query, pagination)
    return Response.success(data=result)
